<template>
  <el-breadcrumb :separator-icon="ArrowRight">
    <el-breadcrumb-item to="/welcome/welcome">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-for="item of arr" :key="item.path" :to="item.path">{{item.name}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script  setup >
import {ref} from 'vue';
import { useRoute } from "vue-router"
import { ArrowRight } from '@element-plus/icons-vue'
let arr = ref([]);
const route = useRoute();
arr = route.matched.map((item) => {
  return {
    path:item.path,
    name:item.meta.name,
  }
});
</script>

<style scoped>

</style>